import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//引入Element ui
import ElementUI, {MessageBox} from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//引入全局样式表
import './assets/css/global.css'
//引入字体样式表
import './assets/fonts/iconfont.css'
//引入axios
import axios from "axios";
//引入element-ui的Message
import Message from "element-ui/packages/message/src/main";
Vue.prototype.$message = Message
//设置axios
axios.defaults.baseURL = "http://127.0.0.1:8888/api/private/v1/"
//配置axios请求拦截器 添加Authorization字段
axios.interceptors.request.use(config=>{
  //console.log(config)
  config.headers.Authorization = window.sessionStorage.getItem('token')
  return config
})
Vue.prototype.$axios = axios
//挂在消息弹出框
Vue.prototype.$confirm = MessageBox.confirm


Vue.config.productionTip = false
Vue.use(ElementUI)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
